<template>
  <Page>
    <el-card shadow="hover" class="custom-box-card">
      <template #header>
        <div class="flex items-center justify-between">
          <span class="text-base">工作台</span>
        </div>
      </template>
      <el-row :gutter="12">
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <div class="flex items-center">
            <div>
              <el-avatar :size="64" :src="schoolboy" />
            </div>
            <div>
              <p class="px-4 text-xl">早安，Ah jung，开始您一天的工作吧！</p>
              <p class="px-4 font-extralight">今日阴转大雨，15℃ - 25℃，出门记得带伞哦。</p>
            </div>
          </div>
        </el-col>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <div class="flex justify-end w-full mt-4 sm:mt-0">
            <div class="flex flex-col justify-center flex-1 text-center md:text-right">
              <span class="text-secondary">项目数</span>
              <span class="text-2xl">16</span>
            </div>
            <div class="flex flex-col justify-center flex-1 text-center md:text-right">
              <span class="text-secondary">待办</span>
              <span class="text-2xl">3/15</span>
            </div>
            <div class="flex flex-col justify-center flex-1 text-center md:text-right">
              <span class="text-secondary">消息</span>
              <span class="text-2xl">35</span>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-card>

    <el-row :gutter="12" class="mt-0">
      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="mt-2">
        <!-- 项目 -->
        <el-card shadow="hover" class="custom-box-card project-card-wrap">
          <template #header>
            <div class="flex items-center justify-between">
              <span class="text-base">项目</span>
            </div>
          </template>
          <div class="flex flex-wrap project-card">
            <el-card shadow="hover" class="cursor-pointer project-card-item" hoverable>
              <div class="flex flex-row items-center">
                <GithubOutlined class="w-10" />
                <span class="ml-4 text-lg">Github</span>
              </div>
              <div class="flex h-10 mt-2 overflow-hidden font-extralight">
                是一个面向开源及私有软件项目的托管平台。
              </div>
              <div class="flex h-10 mt-2 font-extralight"> 开源君，2021-07-04 </div>
            </el-card>
            <el-card
              shadow="hover"
              class="cursor-pointer project-card-item ms:w-1/2 md:w-1/3"
              hoverable
            >
              <div class="flex items-center">
                <TaobaoCircleOutlined class="w-10" style="color: #42b983" />
                <span class="ml-4 text-lg">淘宝网</span>
              </div>
              <div class="flex h-10 mt-2 overflow-hidden font-extralight">
                只有你想不到，没有你淘不到
              </div>
              <div class="flex h-10 mt-2 font-extralight"> 购物天地 2021-04-01</div>
            </el-card>
            <el-card
              shadow="hover"
              class="cursor-pointer project-card-item ms:w-1/2 md:w-1/3"
              hoverable
            >
              <div class="flex items-center">
                <Html5Outlined class="w-10" style="color: #e44c27" />
                <span class="ml-4 text-lg">Html5</span>
              </div>
              <div class="flex h-10 mt-2 overflow-hidden font-extralight">
                HTML5是互联网的下一代标准。
              </div>
              <div class="flex h-10 mt-2 font-extralight"> 撸码也是一种艺术 2021-04-01 </div>
            </el-card>
            <el-card
              shadow="hover"
              class="cursor-pointer project-card-item ms:w-1/2 md:w-1/3"
              hoverable
            >
              <div class="flex items-center">
                <WeiboCircleOutlined class="w-10" style="color: #dd0031" />
                <span class="ml-4 text-lg">微博</span>
              </div>
              <div class="flex h-10 mt-2 overflow-hidden font-extralight">
                分享简短实时信息的社交平台。
              </div>
              <div class="flex h-10 mt-2 font-extralight"> 分享君 2021-07-04。 </div>
            </el-card>
            <el-card
              shadow="hover"
              class="cursor-pointer project-card-item ms:w-1/2 md:w-1/3"
              hoverable
            >
              <div class="flex items-center">
                <QqOutlined class="w-10" style="color: #61dafb" />
                <span class="ml-4 text-lg">腾讯QQ</span>
              </div>
              <div class="flex h-10 mt-2 overflow-hidden font-extralight">
                一款基于互联网的即时通信软件。
              </div>
              <div class="flex h-10 mt-2 font-extralight"> 00后天地 2021-07-04。 </div>
            </el-card>
            <el-card
              shadow="hover"
              class="cursor-pointer project-card-item ms:w-1/2 md:w-1/3"
              hoverable
            >
              <div class="flex items-center">
                <AlipayCircleOutlined class="w-10" style="color: #61dafb" />
                <span class="ml-4 text-lg">支付宝</span>
              </div>
              <div class="flex h-10 mt-2 overflow-hidden font-extralight">
                致力于为企业和个人提供，简单、安全、快速、支付解决方案。
              </div>
              <div class="flex h-10 mt-2 font-extralight"> 支付工具 2021-07-04 </div>
            </el-card>
          </div>
        </el-card>
        <!-- 动态 -->
        <el-card shadow="hover" class="mt-3 custom-box-card">
          <template #header>
            <div class="flex items-center justify-between">
              <span class="text-base">动态</span>
            </div>
          </template>
          <ul class="divide-y divide-gray-300 divide-solid">
            <li v-for="(item, index) in dynamicList" :key="index" class="flex p-4">
              <div>
                <el-avatar :size="40" :src="schoolboy" />
              </div>
              <div class="ml-4">
                <p class="text-base">{{ item.title }}</p>
                <p class="text-sm font-extralight">{{ item.date }}</p>
              </div>
            </li>
          </ul>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="mt-2">
        <el-card shadow="hover" class="custom-box-card project-card-wrap">
          <template #header>
            <div class="flex items-center justify-between">
              <span class="text-base">快捷操作</span>
            </div>
          </template>
          <div class="flex flex-wrap project-card">
            <el-card shadow="hover" size="small" class="cursor-pointer project-card-item" hoverable>
              <div class="flex flex-col justify-center font-extralight">
                <span class="text-center">
                  <DashboardOutlined class="w-8" style="color: #68c755" />
                </span>
                <span class="text-center text-lx">主控台</span>
              </div>
            </el-card>
            <el-card shadow="hover" size="small" class="cursor-pointer project-card-item" hoverable>
              <div class="flex flex-col justify-center font-extralight">
                <span class="text-center">
                  <ProfileOutlined class="w-8" style="color: #fab251" />
                </span>
                <span class="text-center text-lx">列表</span>
              </div>
            </el-card>
            <el-card shadow="hover" size="small" class="cursor-pointer project-card-item" hoverable>
              <div class="flex flex-col justify-center font-extralight">
                <span class="text-center">
                  <FileProtectOutlined class="w-8" style="color: #1890ff" />
                </span>
                <span class="text-center text-lx">表单</span>
              </div>
            </el-card>
            <el-card shadow="hover" size="small" class="cursor-pointer project-card-item" hoverable>
              <div class="flex flex-col justify-center font-extralight">
                <span class="text-center">
                  <ApartmentOutlined class="w-8" style="color: #f06b96" />
                </span>
                <span class="text-center text-lx">权限管理</span>
              </div>
            </el-card>
            <el-card shadow="hover" size="small" class="cursor-pointer project-card-item" hoverable>
              <div class="flex flex-col justify-center font-extralight">
                <span class="text-center">
                  <SettingOutlined class="w-8" style="color: #7238d1" />
                </span>
                <span class="text-center text-lx">系统管理</span>
              </div>
            </el-card>
            <el-card shadow="hover" size="small" class="cursor-pointer project-card-item" hoverable>
              <div class="flex flex-col justify-center font-extralight">
                <span class="text-center">
                  <MailOutlined class="w-8" style="color: #5cdbd3" />
                </span>
                <span class="text-center text-lx">消息</span>
              </div>
            </el-card>
          </div>
        </el-card>
        <!-- 图片 -->
        <el-card shadow="hover" class="mt-3 custom-box-card"
          ><img src="~@/assets/images/Business.svg" class="w-full"
        /></el-card>
      </el-col>
    </el-row>
  </Page>
</template>

<script lang="ts" setup>
  import schoolboy from '@/assets/images/schoolboy.png';
  import {
    GithubOutlined,
    DashboardOutlined,
    ProfileOutlined,
    FileProtectOutlined,
    SettingOutlined,
    ApartmentOutlined,
    Html5Outlined,
    MailOutlined,
    TaobaoCircleOutlined,
    WeiboCircleOutlined,
    QqOutlined,
    AlipayCircleOutlined,
  } from '@vicons/antd';

  const dynamicList = [
    {
      label: 'Ah Jung 刚才把工作台页面随便写了一些，凑合能看了！',
      date: '2021-07-04 22:37:16',
    },
    {
      label: 'Ah Jung 在 开源组 创建了项目 naive-ui-admin？',
      date: '2021-07-04 09:37:16',
    },
    {
      label: '@风清扬，向naive-ui-admin提交了一个bug，抽时间看看吧！',
      date: '2021-07-04 22:37:16',
    },
    {
      label: '技术部那几位童鞋，再次警告，不要摸鱼，不要摸鱼，不要摸鱼啦！',
      date: '2021-07-04 09:37:16',
    },
    {
      label: '上班不摸鱼，和咸鱼有什么区别（这话真不是我说的哈）！',
      date: '2021-07-04 20:37:16',
    },
  ];
</script>

<style lang="scss" scoped>
  // 处理栅格
  .el-row {
    padding-top: 6px;
    margin: -6px;
    .el-row {
      padding-top: 0;
    }
  }
  .el-col {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  // 卡片定制
  .custom-box-card {
    border: none;
  }
  .project-card-wrap {
    > :deep(.el-card__body) {
      padding: 0;
      .project-card {
        &-item {
          width: 33.333333%;
          border: none;
          border-radius: inherit;
          border-right: 1px solid var(--el-border-color-base);
          border-bottom: 1px solid var(--el-border-color-base);
          &:nth-child(3n) {
            border-right: none;
          }
          &:nth-child(n + 4) {
            border-bottom: none;
          }
        }
      }
    }
    .el-card.is-always-shadow {
      box-shadow: none;
    }
    svg {
      display: inline-block;
    }
  }
</style>
